package cc.xuanhaojituan.log4j.service.impl;

import cc.xuanhaojituan.log4j.dao.UserMapper;
import cc.xuanhaojituan.log4j.domain.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author chenli
 * @create 2017-09-13
 */
@Service
public class UserServiceImpl {

    @Autowired
    private UserMapper userMapper;

    public User findByUserId(int userId){
        return userMapper.selectByPrimaryKey(userId);
    }

    public void insert(User user){
        userMapper.insert(user);
    }

    public List<User> findList(){
        return userMapper.getList();
    }
}